
#include "wormnet/IDatabaseModule.h"
#include "wormnet/wmDatabase.h"
#include "wm_Mysql.h"
#include "wm_MSSql.h"

namespace worm
{

WORM_DLL_EXPORT class wmDatabase* ICreateDatabaseModule(const wmEDatabaseType& eDbType)
{
    wmDatabase* pDatabase = NULL;

    switch(eDbType)
    {
    case WM_DB_MYSQL:
        pDatabase = new(wmMysql);
        break;
    case WM_DB_MSSQL:
        pDatabase = new(wmMSSql);
        break;
    case WM_DB_ORACLE:
        break;
    default:
        break;
    }

    return pDatabase;
}

WORM_DLL_EXPORT void IReleaseDatabaseModule(class wmDatabase*& pDatabase)
{
    delete pDatabase;
    pDatabase = NULL;
}

}
